package com.matt.domain.photoalbum;

import com.matt.commons.model.Domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/7/13
 * *******************************
 */
@Entity
@Data
@Table(name = "tb_photo_album_static")
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class PhotoAlbumStatic extends Domain {

    @Column(columnDefinition = " varchar(50)  COMMENT '宝宝姓名'")
    private String name;

    @Column(name = "cid", columnDefinition = " varchar(32)  COMMENT '宝宝id'")
    private String childrenId;

    @Column(name = "aid", columnDefinition = " varchar(32)  COMMENT ' 园区id：园区姓名'")
    private String areaId;

    @Column(name = "areaName", columnDefinition = " varchar(32)  COMMENT ' 园区id：园区姓名'")
    private String areaName;

    @Column(columnDefinition = " varchar(50)  COMMENT '宝宝昵称'")
    private String nickName="";

    @Column(columnDefinition = " int default 0  COMMENT '宝宝性别 ：0：女，1：男'")
    private Integer gender;

    @Column(columnDefinition = "longtext COMMENT '相册元数据,JSON'")
    private String albumMeta;

    @Column(columnDefinition = " varchar(255)  COMMENT '静态文件位置'")
    private String staticURL;

    @Column(columnDefinition = " bit(1) default 0  COMMENT '是否已经请求打印'")
    private Boolean printReqConfirmed;

    @Column(columnDefinition = " datetime COMMENT '是否已经请求打印'")
    private Date requestPrintAt;

    @Column(columnDefinition = " bit(1) default 0  COMMENT '是否已经付费'")
    private Boolean paied;

    @Column(columnDefinition = " int default 0  COMMENT '来源类型, 0. 老师,  1 宝宝家长'")
    private Integer srcType;

    public static PhotoAlbumStatic of(String name, String childrenId, String areaId, String areaName, String nickName, Integer gender, String albumMeta, Integer visitor, Boolean privated) {
        PhotoAlbumStatic ret = new PhotoAlbumStatic();
        ret.name = name;
        ret.childrenId = childrenId;
        ret.areaId = areaId;
        ret.areaName = areaName;
        ret.nickName = nickName;
        ret.gender = gender;
        ret.albumMeta = albumMeta;
        ret.visitor = visitor;
        ret.privated = privated;
        return ret;
    }

    @Column(columnDefinition = " int default 0  COMMENT '请求数量'")
    private Integer visitor;

    @Column(columnDefinition = " bit DEFAULT 0 COMMENT '是否隐藏 0：否，1是' ")
    private Boolean privated = false;
}
